<?php

namespace Models;

class Record extends BaseModel
{
    public function initialize()
    {
        $this->belongsTo("uid", "Models\User", "uid", array('alias' => 'User'));
        $this->belongsTo("from", "Models\User", "uid", array('alias' => 'From'));
        $this->belongsTo("role_id", "Models\Role", "role_id", array('alias' => 'Role'));
    }


    public function notSave()
    {
        //Obtain the flash service from the DI container
        $flash = $this->getDI()->getFlash();

        //Show validation messages
        foreach ($this->getMessages() as $message) {
            $flash->error($message);
        }
    }

}